home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / compguid / objsystk / cheese.sx next >
Encoding:
Text File  |  1996-05-21  |  1.1 KB  |  42 lines  |  [TEXT/ttxt]

  1. -- <<<-
  2.  
  3. module CheeseTest1 uses ScriptX end
  4. in module CheeseTest1
  5.  
  6. function sayCheese x y ->
  7.     print "The best North American cheese comes from Wisconsin"
  8.  
  9. class Cheese ()
  10. instance methods
  11.     method frommage self x ->
  12.         print "The best European cheese comes from France"
  13. end
  14.  
  15. object myCheese (Cheese) end
  16.  
  17. addTimeCallback theCalendarClock sayCheese undefined \
  18.     undefined (theCalendarClock.time + 5) true
  19. addTimeCallback theCalendarClock frommage myCheese \
  20.     undefined (theCalendarClock.time + 5) true
  21.  
  22.  
  23.  
  24.  
  25. addTimeCallback theCalendarClock sayCheese undefined \
  26.     undefined (theCalendarClock.time + 30) true
  27. addTimeCallback theCalendarClock frommage myCheese \
  28.     undefined (theCalendarClock.time + 30) true
  29.  
  30. function sayCheese x y ->
  31.     print "The best North American cheese comes from Ontario"
  32. method frommage self {class Cheese} x ->
  33.     print "The best European cheese comes from Denmark"
  34.  
  35.  
  36.  
  37. addTimeCallback theCalendarClock (a b -> sayCheese a b) undefined \
  38.     undefined (theCalendarClock.time + 30) true
  39. function sayCheese x y ->
  40.     print "The best North American cheese still comes from Wisconsin"
  41. -- >>>
  42.